#pragma once
#include <iostream>
namespace ljt 
{

#define maxsize 100
	typedef int elemtype;
	typedef struct
	{
		elemtype elem[maxsize];
		int front, rear;
	}seqqueue;

	void initQueue(seqqueue& q)
	{
		q.rear = -1;
		q.front = 0;
	}
	void queuePush(seqqueue &q, elemtype x)
	{
		q.elem[++q.rear] = x;
	}
	void queuePop(seqqueue &q)
	{
		q.front++;
	}
	elemtype queueFront(seqqueue& q)
	{
		return q.elem[q.front];
	}
	elemtype queueBack(seqqueue& q)
	{
		return q.elem[q.rear];
	}
	int size(seqqueue& q)
	{
		return q.rear - q.front + 1;
	}
}